<?php

namespace app\admin\validate;

class UploadValidate extends BaseValidate
{
    protected $rule = [
        'type' => 'require',
        'chunkNumber' => 'require|integer',
        'chunkSize' => 'require|integer',
        'currentChunkSize' => 'require|integer',
        'totalSize' => 'require|integer',
        'identifier' => 'require',
        'filename' => 'require',
        'relativePath' => 'require',
        'totalChunks' => 'require|integer',
    ];

    protected $message = [
        'id' => 'id必须',
        'type.require' => '类型必须',
        'chunkNumber.require' => '分片号必须',
        'chunkNumber.integer' => '分片号必须为整数',
        'chunkSize.require' => '分片大小必须',
        'chunkSize.integer' => '分片大小必须为整数',
        'currentChunkSize.require' => '当前分片大小必须',
        'currentChunkSize.integer' => '当前分片大小必须为整数',
        'totalSize.require' => '总大小必须',
        'totalSize.integer' => '总大小必须为整数',
        'identifier.require' => '标识必须',
        'filename.require' => '文件名必须',
        'relativePath.require' => '相对路径必须',
        'totalChunks.require' => '总分片数必须',
    ];

    protected $scene = [
        'uploader_common' => ['type'],
    ];
}